-
Notifications
You must be signed in to change notification settings - Fork 3.6k
HHH-19365 GaussDB Dialect Support #10199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Everything is ready for review |
Build and test:
BUILD SUCCESSFUL in 25m 56s |
IMHO, the GaussDB Dialect should extends PostgreSQL Dialect to reuse code as possible, not to duplicate all related sources. |
Actually, GaussDB has many different features than PostgreSQL and now the tested mode is Oracle compatibility . In future, GaussDB will not compatible with PostgreSQL but with OpenGauss. And a separation of code may help us testing and add new features. Your suggestion is quite good for less code duplication. But there are some potential risks. For example, a contributor modified PostgreSQL related code will influence GaussDB, however, Hibernate community is not respnosible for fixing problems in community dialect. |
int count = 0; | ||
for ( int i = 0; i < size; i++ ) { | ||
final ValuedModelPart modelPart = getEmbeddedPart( embeddableMappingType, orderMapping[i] ); | ||
if ( modelPart.getMappedType() instanceof EmbeddableMappingType embeddableMappingType ) { |
Check notice
Code scanning / CodeQL
Possible confusion of local and field Note
getJdbcValueSelectable
embeddableMappingType
return DateTimeFormatter.ISO_LOCAL_TIME.parse( subSequence, LocalTime::from ); | ||
} | ||
|
||
private Object parseTimestamp(CharSequence subSequence, JavaType<?> jdbcJavaType) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
return rawJdbcValue.toString(); | ||
} | ||
|
||
protected <X> String toString(X value, JavaType<X> javaType, WrapperOptions options) throws SQLException { |
Check notice
Code scanning / CodeQL
Useless parameter Note
case SqlTypes.DECIMAL: | ||
case SqlTypes.NUMERIC: | ||
case SqlTypes.DURATION: | ||
appender.append( subValue.toString() ); |
Check warning
Code scanning / CodeQL
Dereferenced variable may be null Warning
subValue
this
Variable
subValue
this
); | ||
break; | ||
case SqlTypes.UUID: | ||
appender.append( subValue.toString() ); |
Check warning
Code scanning / CodeQL
Dereferenced variable may be null Warning
subValue
this
Variable
subValue
this
new TemplatedViolatedConstraintNameExtractor( sqle -> { | ||
final String sqlState = JdbcExceptionHelper.extractSqlState( sqle ); | ||
if ( sqlState != null ) { | ||
switch ( Integer.parseInt( sqlState ) ) { |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
/** | ||
* Allow for extension points to override this only | ||
*/ | ||
protected void contributeGaussDBTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
private static final String XML_QUERY_SEPARATOR = "' passing "; | ||
private static final String XML_QUERY_END = " columns v xml path '.')t)"; | ||
|
||
public static AggregateSupport valueOf(Dialect dialect) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
As discussed, move new Dialect Support to community.
see old PR to core #10093
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-19365